package com.mallcai.bigdata.ladon.service.report.impl.handler.support.rule;

import com.mallcai.bigdata.ladon.dpl.vo.DataType;

/**
 * @author feixy
 * @version 1.0
 * @date 2019-07-21 20:22
 */
public abstract class AbstractStringRuleOperator extends AbstractNotCollectionRuleOperator {

    @Override
    public boolean test(Object obj1, Object obj2) {
        if (!super.test(obj1, obj2)){
            return false;
        }
        return innerTest(String.valueOf(obj1), String.valueOf(obj2));
    }

    protected abstract boolean innerTest(String obj1, String obj2);


    @Override
    public final DataType[] getSupportDataTypes() {
        return IRuleOperator.STRING_DATA_TYPE;
    }
}
